home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / progjour / 1990 / 05 / wtest.asm < prev    next >
Assembly Source File  |  1990-08-06  |  5KB  |  168 lines

  1.         title   wtest - window test
  2.         include window.inc
  3.         include asm.inc
  4.  
  5.         .stack
  6.  
  7.         .data
  8. quick_txt       db      'The quick brown fox jumps over the lazy dog.'
  9. now_txt         db      'Now is the time for all good men ...'
  10.  
  11. one_txt         db      '1'
  12. two_txt         db      '22'
  13. three_txt       db      '333'
  14. four_txt        db      '4444'
  15. five_txt        db      '55555'
  16. test2_txt       db      'Test 2'
  17. hidden_txt      db      'HiddenText'
  18. stars_txt       db      '******************************'
  19.  
  20. twenty_txt      db      'twenty*twenty*twenty'
  21. thirty_txt      db      '*thirty*thirty*thirty*thirty**'
  22. forty_txt       db      'forty#forty#forty#forty#forty#forty#fort'
  23. ninety_txt      db      15 dup ('ninety')
  24.  
  25. test_str struc
  26.   t_handle      dw      ?
  27.   t_origin_x    db      ?
  28.   t_origin_y    db      ?
  29.   t_size_x      db      ?
  30.   t_size_y      db      ?
  31.   t_x           db      ?
  32.   t_y           db      ?
  33.   t_offset      dw      ?
  34.   t_bc          dw      ?
  35. test_str ends
  36.  
  37.         even
  38. w0      test_str  <0, 0,0,    90,1,   0,0,  ninety_txt,  90> ;size ninety_txt>
  39. w1      test_str  <0, 1,1,    1,1,    0,0,  one_txt,     1>  ;size one_txt>
  40. w2      test_str  <0, 2,1,    2,1,    0,0,  two_txt,     2>  ;size two_txt>
  41. w3      test_str  <0, 4,1,    3,1,    0,0,  three_txt,   3>  ;size three_txt>
  42. w4      test_str  <0, 7,1,    4,1,    0,0,  four_txt,    4>  ;size four_txt>
  43. w5      test_str  <0, 11,1,   5,1,    0,0,  five_txt,    5>  ;size five_txt>
  44. w6      test_str  <0, 1,2,    60,5,   50,5, test2_txt,   6>  ;size test2_txt>
  45. w_count0        equ     ($-w0)/size test_str
  46.  
  47. w10     test_str  <0, 0,0,    40,1,   0,0,  quick_txt,   44> ;size quick_txt>
  48. w11     test_str  <0, 0,1,    90,1,   1,0,  ninety_txt,  90> ;size ninety_txt>
  49. w12     test_str  <0, 0,2,    20,1,   0,0,  0,           0>
  50. w13     test_str  <0, 20,2,   20,1,   0,0,  0,           0>
  51. w14     test_str  <0, 0,3,    40,1,   0,0,  0,           0>
  52. w15     test_str  <0, 20,4,   10,1,   0,0,  0,           0>
  53. w16     test_str  <0, 10,2,   20,3,   0,0,  0,           0>
  54. w_count10       equ     ($-w10)/size test_str
  55.  
  56.  
  57.         .code
  58.         extn    startup,WCreateWindow,WDrawText,WPreset
  59.  
  60.         extrn    row_count:byte, column_count:byte
  61.  
  62. ;;      main
  63. ;
  64. main    proc
  65.         mov     ax,@data
  66.         mov     ss,ax
  67.         mov     sp,offset stack
  68.         mov     sp,ax
  69.         call    startup
  70.         call    WPreset
  71.  
  72.         mov    ah,06h          ;Scroll row_count lines to clear screen
  73.         mov    dh,row_count    ;  and column_count columns
  74.         mov    dl,column_count
  75.         mov    al,0            ; blank the screen
  76.         mov    bh,7
  77.         mov    cx,0
  78.         int 10h              
  79.  
  80.         mov     ax,@data
  81.         mov     ds,ax
  82.         lea     si,w0
  83.         mov     cx,w_count0
  84. mai1:   pushm   cx,si,ds
  85.         mov     bx,NULL_WINDOW
  86.         mov     cl,t_origin_x[si]
  87.         mov     ch,t_origin_y[si]
  88.         mov     dl,t_size_x[si]
  89.         mov     dh,t_size_y[si]
  90.         call    WCreateWindow
  91.         mov     t_handle[si],bx
  92.         mov     cx,t_bc[si]
  93.         mov     dl,t_x[si]
  94.         mov     dh,t_y[si]
  95.         mov     si,t_offset[si]
  96.         call    WDrawText
  97.  
  98.         popm    ds,si,cx
  99.         add     si,size test_str
  100.         loop    mai1
  101.  
  102.         lea     si,w10
  103.         mov     cx,w_count10
  104. mai2:   pushm   cx,si,ds
  105.         mov     bx,w6.t_handle
  106.         mov     cl,t_origin_x[si]
  107.         mov     ch,t_origin_y[si]
  108.         mov     dl,t_size_x[si]
  109.         mov     dh,t_size_y[si]
  110.         call    WCreateWindow
  111.         mov     t_handle[si],bx
  112.         mov     cx,t_bc[si]
  113.         mov     dl,t_x[si]
  114.         mov     dh,t_y[si]
  115.         mov     si,t_offset[si]
  116.         call    WDrawText
  117.  
  118. mai3:   popm    ds,si,cx
  119.         add     si,size test_str
  120.         loop    mai2
  121.  
  122.         mov     bx,w16.t_handle
  123.         mov     cx,30 ;size stars_txt
  124.         mov     dx,0
  125.         lea     si,stars_txt
  126.         call    WDrawText
  127.  
  128.         mov     dh,1
  129.         call    WDrawText
  130.  
  131.         mov     dh,2
  132.         call    WDrawText
  133.  
  134.  
  135.         mov     bx,w12.t_handle
  136.         mov     cx,44 ;size quick_txt
  137.         lea     si,quick_txt
  138.         mov     dx,0
  139.         call    WDrawText
  140.  
  141.  
  142.         mov     bx,w13.t_handle
  143.         mov     cx,36 ;size now_txt
  144.         lea     si,now_txt
  145.         call    WDrawText
  146.  
  147.  
  148.         mov     bx,w14.t_handle
  149.         mov     cx,44 ;size quick_txt
  150.         lea     si,quick_txt
  151.         call    WDrawText
  152.  
  153.  
  154.         mov     bx,w15.t_handle
  155.         mov     cx,10 ;size hidden_txt
  156.         lea     si,hidden_txt
  157.         call    WDrawText
  158.  
  159.         ;Wait for a keypress
  160.     mov    ah,1        ;wait for a key
  161.     int    21h        ;
  162.  
  163.         mov     ax,4C00h
  164.         int     21h
  165. main    endp
  166.  
  167.         end     main
  168.